<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>已处理调价计划</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
	<style type="text/css">
    .box-body{
    margin-top:-10px;
    }    	
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
	<section class="content-header">
        <h1>已处理调价计划</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">交易</a></li>
			<li class="active"><a href="#">药品调价</a></li>
            <li class="active"><a href="#">已处理调价计划</a></li>
        </ol>
    </section>
    <section class="content">
       <form id="form" method="post" class="form-horizontal">
         <div class=" box box-success">
          <div class="box-body">
                <div class="input">
                    <div class="textalign1">计划名称：</div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="priceAdjPlanName" placeholder="计划名称"/>
                    </div>
                    <div class="textalign" >制定时间：</div>
                    <div class="boxinput"> 
                        <table style="width:100%;">
                                <tr>
                                    <td style="width:50%">       
                                        <input class="textinput"  id='createStartTime' type="text"  placeholder="yyyy-MM-dd" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'createEndTime\')}'})"  />
                        
						            </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">       
                                        <input class="textinput" id='createEndTime' type="text" placeholder="yyyy-MM-dd" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'createStartTime\')}'})"  />
                       
                                    </td>
                                </tr>
                         </table>        
                    </div>
                    <div class="textalign" >执行时间：</div>
                    <div class="boxinput"> 
                        <table style="width:100%;">
                                <tr>
                                    <td style="width:50%">       
                                        <input class="textinput"  id='executeStartTime' type="text"  placeholder="yyyy-MM-dd"  onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'executeEndTime\')}'})" />
                        
						            </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">       
                                        <input class="textinput" id='executeEndTime' type="text"   placeholder="yyyy-MM-dd"  onFocus="WdatePicker({minDate:'#F{$dp.$D(\'executeStartTime\')}'})" />
                        
                                    </td>
                                </tr>
                         </table>        
                    </div>
                    <div class="input">
                         <div class="textalign1">执行方式：</div>
                         <div class="boxinput">
                             <select class="textinput" id="executeCat">
							 <option value="">请选择</option>
                       		 <option value="1">手动执行</option>
                       		 <option value="2">自动执行</option>
                           	 </select>
                         </div>
                         <div class="textalign" >
                             <button type="button" class="btn btn-success btn-sm" onclick="gridReload()" id="selectc">查&nbsp;询</button>
                         </div>
                    </div>
                </div>
          
			</div>
		  </div>
		</form>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

    </section>

	<form action="${ctx}/wsjPriceAdjust/toPriceDetailList.html" method="post" id="Form">
		<input type="hidden" name="priceAdjPlanId" id="priceAdjPlanId">
	</form>
	
	<%@ include file="/WEB-INF/component/commonJS.jsp"%>
	
	<script type="text/javascript">
	 //绑定回车
    $('#priceAdjPlanName,#createStartTime,#createEndTime,#executeStartTime,#executeEndTime').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectc').click();
        }
    }); 
		
    $("#priceAdjPlanName").focus();//加载页面光标在第一个查询框内
    
		jQuery("#gridlist").jqGrid({
			url: "${ctx}/wsjPriceAdjust/getPriceAdjPlanList.html",
		    mtype: "post",
			datatype: "json",
			autowidth: true,
		//	height: 270,
		   	colNames:['操作','','计划名称','执行方式','制定时间','执行时间','调价依据'],
		   	colModel:[
                {name:'opts',width:50,align:"center",sortable:false,
  		             formatter : function(val, opts,rowdata) {
		             var str = "<a href=\"javascript:edit('"+ rowdata.priceAdjPlanId+ "');\" style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px -60px' class='opIcon' title='查看明细'></a>";
		             return str;
	               }		
	            },
				{name:'priceAdjPlanId',hidden:true,width:0,align:"center", sortable:false},
		   		{name:'priceAdjPlanName',width:200,align:"left", sortable:false},
		   		{name:'executeCat',width:120,align:"center", sortable:false},
				{name:'createDatetime',width:160, align:"center",sortable:false },
		   		{name:'executeDatetime',width:160, align:"center",sortable:false },
		   		{name:'priceAdjAccord', width:180, align:"left", sortable:false }
		   		
		   	],
			
			 rowNum: 20,
			 rowList: [10, 20, 50, 100],
		     rownumbers: true,
		     pager: "#gridpage",
		     viewrecords: true,
		     caption: "已处理调价计划",
		     editurl:"priceChangeList.jsp",
		     jsonReader: {
		         id: "priceAdjPlanId"
		     },
		     gridComplete:function(){
                 //序号列宽度自适应（参数为jqgridID）
                 autoRNWidth("gridlist");
                 //数据只有一条时默认选中（参数为jqgridID）
                 selectByOneData("gridlist");
             }
		   	
		});
		 
		jQuery("#gridlist").jqGrid('navGrid',"prowed2",{edit:false,add:false,del:false});
		$("#gridlist").jqGrid("setGridHeight",create());
		function edit(cl){
			$("#priceAdjPlanId").val(cl);
			$("#Form").submit();
		}
		
		function gridReload(page){
			var priceAdjPlanName = $.trim($("#priceAdjPlanName").val());
			var executeCat = $("#executeCat").val();
			var createStartTime = $("#createStartTime").val();
			var createEndTime = $("#createEndTime").val();
			var executeStartTime = $("#executeStartTime").val();
			var executeEndTime = $("#executeEndTime").val();
			
			jQuery("#gridlist").jqGrid('setGridParam',{  
				mtype: "POST",
		        datatype:'json',
		        postData:{"priceAdjPlanName":priceAdjPlanName,"executeCat":executeCat,"createStartTime":createStartTime,
				          "createEndTime":createEndTime,"executeStartTime":executeStartTime,"executeEndTime":executeEndTime},
		        page : (page || 1)
		    }).trigger("reloadGrid"); //重新载入  
		}
	</script>
</body>
</html>